<!--
 * @Author: kangjia
 * @Date: 2022-08-16 14:30:02
 * @LastEditors: kangjia
 * @LastEditTime: 2022-10-12 16:19:34
 * @FilePath: \boss-web-applet\pages\service\order\paySuccess\module\voesOrPms.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
	<view>
    <view class="cu-list menu card-menu margin-tb" >
      <view class="default-item bg-white">
        <view class="text-darkGray text-sm">
          <text class="lg text-orange cuIcon-notificationfill" style="font-size:30rpx"></text>
          <text>{{$t('JLink.paySuccess.voesOrPms.text')}}</text>
        </view>
        <view class="text-right">
          <button class="cu-btn round line-primary text-sm" style="height:56upx"  @tap="handlebindPhone">{{$t('JLink.paySuccess.voesOrPms.setPhone')}}</button>
        </view>
      </view>
    </view>
    <item v-if="isShow.devState" :text="$t('JLink.paySuccess.deviceOffline')" :arrow="false" icon="infofill"></item>
    <slot></slot>
  </view>
</template>

<script>
import constants from '@/utils/constants.js'
import item from './item.vue'

const { GROUPTYPE } = constants;

export default {
  components: {
    item
  },
  props:{
    isShow:{
      type:Object,
      default:()=>{
        return {
          devState:false,//设备是否离线
        }
      }
    },
    classifyId:{
      type:String,
      default:''
    },
    urlParams:{
      type:Object,
      default:()=>{
        return{}
      }
    }
  },
  methods: {
    handlebindPhone () {
      const {devId} = this.urlParams;
      GROUPTYPE().forEach(z=>{
        if(this.classifyId===z.classifyId){
			this.$routing(`${this.$pages.setPhones}?sn=${devId}&type=${z.type}&devName=${devId}`)
          // uni.navigateTo({
          //   url: `/jvss/pages/service/configs/setPhones?sn=${devId}&type=${z.type}&devName=${devId}`
          // });
        }
      })
    }
  }
}
</script>

<style lang="less" scope>
@import '@/common/style/main.css';
</style>